/*    */ package handling.cashshop;
/*    */ 
/*    */ import configs.ServerConfig;
/*    */ import handling.ServerType;
/*    */ import handling.channel.PlayerStorage;
/*    */ import handling.netty.ServerConnection;
/*    */ import org.apache.logging.log4j.LogManager;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ 
/*    */ public class CashShopServer
/*    */ {
/* 12 */   private static final Logger log = LogManager.getLogger(CashShopServer.class);
/*    */   private static String ip;
/*    */   private static ServerConnection init;
/*    */   private static PlayerStorage players;
/*    */   private static boolean finishedShutdown = false;
/*    */   private static short port;
/*    */   
/*    */   public static void run_startup_configurations() {
/* 20 */     port = ServerConfig.CASH_PORT;
/* 21 */     ip = ServerConfig.WORLD_INTERFACE;
/* 22 */     players = new PlayerStorage(-10);
/*    */     try {
/* 24 */       init = new ServerConnection(port, 0, -10, ServerType.商城服务器);
/* 25 */       init.run();
/* 26 */     } catch (Exception e) {
/* 27 */       throw new RuntimeException("商城服务器绑定端口 " + port + " 失败", e);
/*    */     } 
/*    */   }
/*    */   
/*    */   public static String getIP() {
/* 32 */     return ip;
/*    */   }
/*    */   
/*    */   public static short getPort() {
/* 36 */     return port;
/*    */   }
/*    */   
/*    */   public static PlayerStorage getPlayerStorage() {
/* 40 */     return players;
/*    */   }
/*    */   
/*    */   public static int getConnectedClients() {
/* 44 */     return getPlayerStorage().getConnectedClients();
/*    */   }
/*    */   
/*    */   public static void shutdown() {
/* 48 */     if (finishedShutdown) {
/*    */       return;
/*    */     }
/* 51 */     log.info("正在关闭商城服务器...");
/* 52 */     players.disconnectAll();
/* 53 */     log.info("商城服务器解除端口绑定...");
/* 54 */     init.close();
/* 55 */     finishedShutdown = true;
/*    */   }
/*    */   
/*    */   public static boolean isShutdown() {
/* 59 */     return finishedShutdown;
/*    */   }
/*    */   
/*    */   public static String getCashBlockedMsg(int itemId) {
/* 63 */     switch (itemId) {
/*    */       case 5050000:
/*    */       case 5060003:
/*    */       case 5072000:
/*    */       case 5073000:
/*    */       case 5074000:
/*    */       case 5076000:
/*    */       case 5077000:
/*    */       case 5079001:
/*    */       case 5079002:
/*    */       case 5360000:
/*    */       case 5360014:
/*    */       case 5360015:
/*    */       case 5360016:
/*    */       case 5390000:
/*    */       case 5390001:
/*    */       case 5390002:
/*    */       case 5390003:
/*    */       case 5390004:
/*    */       case 5390005:
/*    */       case 5390006:
/*    */       case 5390007:
/*    */       case 5390008:
/*    */       case 5390010:
/* 87 */         return "该道具只能通过NPC购买.";
/*    */     } 
/* 89 */     return "该道具禁止购买.";
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\handling\cashshop\CashShopServer.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */